/**
 * Copyright (c) 2018, wuxie All rights reserved.
 * qq:16349023,mail:16349023@qq.com
 * 未经许可禁止任何人通过任何渠道使用、修改源代码.
 * 项目名称 : wxcloud
 *
 * @version V1.0
 */
package cn.xo68.boot.auth.core.configuration;

import cn.xo68.boot.auth.core.shiro.cache.ShiroSpringCacheManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.CacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;



/**
 *  基于redis的shiro缓存及会话管理配置
 * @author wuxie
 * @date 2018/8/5 17:16
 *
 */
@Configuration
public class ShireCacheConfiguration {


    /**
     * shiro cache
     * @param cacheManager
     * @return
     */
    @Bean
    public ShiroSpringCacheManager shiroSpringCacheManager(@Autowired(required = false) CacheManager cacheManager){
        ShiroSpringCacheManager shiroSpringCacheManager=new ShiroSpringCacheManager();
        shiroSpringCacheManager.setCacheManager(cacheManager);

        return shiroSpringCacheManager;
    }




}
